package com.zlf.mapper;

import com.zlf.po.Remark;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface RemarkMapper {

    @Insert("insert into remark(userId,userName,businessId,remarkDate,remark) values(#{userId},#{userName},#{businessId},#{remarkDate},#{remark})")
    @Options(useGeneratedKeys = true,keyProperty = "remarkId",keyColumn = "remarkId")
    public int saveRemarks(Remark remark);

    @Delete("delete from remark where remarkId=#{remarkId}")
    public int deleteRemark(int remarkId);

    @Select("select * from remark where businessId=#{businessId} order by remarkDate")
    public List<Remark> listRemarksByBussinessId(Integer businessId);
}
